<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,initial-scale=1.0,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>{php echo $this->title;}</title>
<meta name="keywords" content="早起打卡网-早起有奖励！亿万用户在参与,健康从早起开始,赶快加入挑战吧！">
<meta name="description" content="早起打卡网-早起有奖励！亿万用户在参与,健康从早起开始,赶快加入挑战吧！">
<link rel="stylesheet" href="../addons/dashen_zaoqizhuanqian/css/idangerous.swiper.css?asQ">
<link rel="stylesheet" href="../addons/dashen_zaoqizhuanqian/css/animation.css?asQ">
<link rel="stylesheet" href="../addons/dashen_zaoqizhuanqian/css/style.css?asQ">
  <link rel="stylesheet" href="../addons/dashen_zaoqizhuanqian/css/idangerous.swiper.css?Hz2">
  <link rel="stylesheet" href="../addons/dashen_zaoqizhuanqian/css/animation.css?Hz2">
  <link rel="stylesheet" href="../addons/dashen_zaoqizhuanqian/css/style.css?Hz2">
<script src="../addons/dashen_zaoqizhuanqian/js/jquery-1.9.1.min.js?asQ" type="text/javascript"></script>
<script src="../addons/dashen_zaoqizhuanqian/js/jquery.form.js?asQ" type="text/javascript"></script>
<script src="../addons/dashen_zaoqizhuanqian/js/rem.js?asQ" type="text/javascript"></script>
<script src="../addons/dashen_zaoqizhuanqian/js/fastclick.js?asQ" type="text/javascript"></script>
<script src="../addons/dashen_zaoqizhuanqian/js/jquery.similar.msgbox.js" type="text/javascript"></script>
<script src="../addons/dashen_zaoqizhuanqian/js/idangerous.swiper.min.js" type="text/javascript"></script>
<script src="../addons/dashen_zaoqizhuanqian/js/common.js" type="text/javascript"></script>
<style>
.wrap{width:6.4rem;}
.Color,.FixedPay .FixedPayList ul li.Hover span.iconfont{color:#FF801A;}
.BorderColor{border-color:#FF801A;}
.Bg,#mb_btn_ok,.Ad .swiper-container-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet-active{background:#FF801A;color:#fff;}

.daojishi {color:#666;background:white;border:1px solid #eee;border-radius:4px;padding:2px 10px;margin:3px;}

</style>
  <script>
    $(document).ready(function (e) {
      var counter = 0;
      if (window.history && window.history.pushState) {
        $(window).on('popstate', function () {
          window.history.pushState('forward', null, '#');
          window.history.forward(1);
          // alert("不可回退");  //如果需在弹框就有它
          location.href="{php echo $this->createMobileUrl('Index')}"; //如查需要跳转页面就用它
        });
      }

      window.history.pushState('forward', null, '#'); //在IE中必须得有这两行
      window.history.forward(1);
    });
  </script>
  <script>
var Config = new Object();
Config.MsgBox_ok = '确定';
Config.MsgBox_no = '取消';

</script>
  <style>
    div,ul,li{margin: 0;padding: 0}/*先初始化一下默认样式*/
    .notice {
      width: 100%;/*单行显示，超出隐藏*/
      height: 35px;/*固定公告栏显示区域的高度*/
      padding: 0 0;
      background-color: #b3effe;
      overflow: hidden;
    }
    .notice ul li {
      list-style: none;
      line-height: 35px;
      /*以下为了单行显示，超出隐藏*/
      display: block;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
      padding-left:10px;
    }
  </style>
  <script>
    $(function () {
      // 调用 公告滚动函数
      setInterval("noticeUp('.notice ul','-35px',500)", 3000);
    });
    function noticeUp(obj,top,time) {
      $(obj).animate({
        marginTop: top
      }, time, function () {
        $(this).css({marginTop:"0"}).find(":first").appendTo(this);
      })
    }
  </script>
</head>
<body class="white">
<!--<div class="mui-input-cell">-->
  <!--{php echo tpl_app_form_field_image('image', $image);}-->
<!--</div>-->
{if $nostate==1 && $notice !=null}
<div class="notice">
  <ul>
    {loop $notice $v}
    <a href="./index.php?i=<?php echo $uniacid?>&c=entry&do=info&m=dashen_zaoqizhuanqian&nid={$v[id]}"><li>{$v[title]}</li></a>
    {/loop}
  </ul>
</div>
{/if}
<div class="wrap pb3">  
  <div class="Head">
    <div class="HeadMain">
      <div class="SmallTitle">明早打卡可瓜分金额(元)</div>
      <div class="Money">{php echo $total_money+$this->xmoney}{if $daymoney !=''}+{$daymoney[money]}{/if}元</div>
      <div class="Numbers">当前有<em>{php echo count($yajin_list)+$this->xnumber}</em>人参与打卡挑战</div>
      <div class="HeadUser">
        <ul>
          {if count($yajin_list) <26 }
          {loop $yajin_list $k $v}
          <li><img src="{php echo $v['headimgurl']==''?'../addons/dashen_zaoqizhuanqian/images/moren.jpg':$v['headimgurl']}"></li>
          {/loop}
          {loop $images $k $v}
          {if $k+count($yajin_list)<26}
          <li><img src="{php echo tomedia($v)}"></li>
          {/if}
          {/loop}
          {else}
          {loop $yajin_list $k $v}
          {if $k<26}
           <li><img src="{php echo $v['headimgurl']==''?'../addons/dashen_zaoqizhuanqian/images/moren.jpg':$v['headimgurl']}"></li>
          {/if}
          {/loop}
          {/if}
          </ul>
        <div class="both"></div>
      </div>
      <?php
        $a=explode('.',$starttime);
        $b=$a[0].':'.($starttime-$a[0])*60;
        if($a[1]==0){
         $b=$a[0].':'.'00';
        }
		$c=explode('.',$endtime);
		$d=$c[0].':'.($endtime-$c[0])*60;
		 if($c[1]==0){
         $d=$c[0].':'.'00';
        }
      ?>
       <span style="font-size:0.2rem;">打卡时间 {php echo  $b.'-'.$d }</span>
      <a href="./index.php?i=<?php echo $uniacid?>&c=entry&do=rule&m=dashen_zaoqizhuanqian" class="AppLink Rule" style="background:#FF0000">挑战规则 ></a>
     <style>
       .Head .left {
         position: absolute;
         left: 0;
         bottom: 0.15rem;
         width: 0.9rem;
         z-index: 2;
       }
     </style>
      <div class="Cleardog"></div>
      <div class="left">
        <ul>
          <li>
            <!--<a href="./index.php?i=<?php echo $uniacid?>&c=entry&do=dkmx&m=dashen_zaoqizhuanqian" class="AppLink"><img src="../addons/dashen_zaoqizhuanqian/images/ranking.png"></a>-->
            <a href="./index.php?i=<?php echo $uniacid?>&c=entry&do=yqhy&m=dashen_zaoqizhuanqian" class="AppLink"><img src="../addons/dashen_zaoqizhuanqian/images/wdyy.png"></a>
          </li>
        </ul>
      </div>
      <div class="Right">
        <ul>
          <li>
            <a href="./index.php?i=<?php echo $uniacid?>&c=entry&do=tixianrecord&m=dashen_zaoqizhuanqian" class="AppLink"><img src="../addons/dashen_zaoqizhuanqian/images/tixian.png"></a>
          </li>
          <li>
            <a href="./index.php?i=<?php echo $uniacid?>&c=entry&do=signrecord&m=dashen_zaoqizhuanqian" class="AppLink"><img src="../addons/dashen_zaoqizhuanqian/images/continuousFighting.png"></a>
          </li>
          <li>
            <a href="./index.php?i=<?php echo $uniacid?>&c=entry&do=ranking&m=dashen_zaoqizhuanqian" class="AppLink"><img src="../addons/dashen_zaoqizhuanqian/images/ranking.png"></a>
          </li>
           <li>
            <a href="./index.php?i=<?php echo $uniacid?>&c=entry&do=yaoqing&m=dashen_zaoqizhuanqian" class="AppLink"><img src="../addons/dashen_zaoqizhuanqian/images/yaoqing.png"></a>
          </li>
          <!--<li>-->
            <!--<a href="./index.php?i=<?php echo $uniacid?>&c=entry&do=yqhy&m=dashen_zaoqizhuanqian" class="AppLink"><img src="../addons/dashen_zaoqizhuanqian/images/yaoqing.png"></a>-->
          <!--</li>-->
        </ul>
      </div>
    </div>
  </div>
  {if $openid==$set['user_openid']&&$this->fstate==1}
  <div style="margin-top: 20px;margin-bottom: -20px;margin-left: 45%;background-color: green;border-radius: 5%;width: 15%;height: 30px;font-size: 20px;color: white;text-align: center"  id="fenqian">分钱</div>
  {/if}
  <script>
    $('#fenqian').click(function () {
        window.location.href="./index.php?i="+uniacid+"&c=entry&do=Send&m=dashen_zaoqizhuanqian";
    })
  </script>
  {if $is_tiao=='0'}
  {if  count($yajins) ==1}
  {loop $yajins $v}
  <div onclick="tiaozhan({$v})" class="ComminSubmit SubmitPay">{$v}元</div>
  {/loop}
  {else}
  <!--<div class="ComminSubmit SubmitPay">{php echo $other['tiaozhan']==''?'我要挑战':trim($other['tiaozhan']);}</div>-->
  <div style="" align="center">
      <select style="width: auto;padding: 0 24%;margin: 0;border:none;margin-top:20px;text-align:center;text-align-last: center;"  onchange="change(0)" class="ComminSubmit SubmitPay"  id="xuanze" name="" align="center">
        <option  value="" style="text-align:center;width:auto;">{php echo $other['tiaozhan']==''?'我要挑战':trim($other['tiaozhan']);}</option>
        {loop $yajins $v}
        <option value="{$v}">支付{$v}元参与挑战</option>
        {/loop}
      </select>
  </div>
  {/if}
  {elseif $is_tiao=='1'}
  <div style="" align="center">
    <select style="padding-left:35%;text-align: center;border:none;"  onchange="change(1)" class="ComminSubmit SubmitPay"  id="zhuijia" name="" align="center">
      <option  value="">追加挑战金</option>
      {loop $zyajins $v}
      <option value="{$v}">追加{$v}元</option>
      {/loop}
    </select>
  </div>
  {elseif $is_tiao=='2'}
  <div class="ComminSubmit CountDownTime">我要打卡</div>
  {/if}
  {if $is_tiao=='3'}
  <div class="ComminSubmit ">已加入挑战</div>
  {/if}
  {if $is_tiao=='4'}
  <div class="ComminSubmit ">金额核算中</div>
  {/if}
  {if $this->djstate==1}
  <div id="time" class="time-item" style="height:60px;background:#ff8500;text-align: center;padding-top:10px;font-size:13px;margin-top: 10px;margin-left: 5%;margin-right: 5%;border-radius: 1%">
    <div style="color:#666;font-size:13px;">打卡倒计时</div>
    <div style="padding-top:10px;">
      <span id="day_show" style="" class="daojishi">0天</span>
      <span id="hour_show" class="daojishi">0时</span>
      <span id="minute_show" class="daojishi">0分</span>
      <span id="second_show" class="daojishi">0秒</span>
      <input id="sj" hidden value="{$time}">
    </div>
  </div>
  {/if}
  <script type="text/javascript">
    function lala(sid) {
      $("#lapiao").attr("href","{php echo $this->createMobileUrl('Index',array('action'=>'wodehaibao'))}&sid="+sid);
    }
    var note = $('#note'),
            ts = new Date(2012, 0, 1),
            newYear = true;
    function p(s) {
      return s < 10 ? '0' + s: s;
    }
    var myDate = new Date();
    //获取当前年
    var year=myDate.getFullYear();
    //获取当前月
    var month=myDate.getMonth()+1;
    //获取当前日
    var date=myDate.getDate();
    var h=myDate.getHours();       //获取当前小时数(0-23)
    var m=myDate.getMinutes();     //获取当前分钟数(0-59)
    var s=myDate.getSeconds();
    var start=year+'-'+p(month)+"-"+p(date)+" "+p(h)+':'+p(m)+":"+p(s);

    var end=$('.endtime').val();
    var time1 = Date.parse(new Date(start));
    var time2 = Date.parse(new Date(end));
    var nDays = Math.abs(parseInt((time2 - time1)))/1000;
    var sj=nDays;
    var gid = $("#gid").val();
    //alert(gid);
    var djs="{$djs}";
    var intDiff = parseInt(djs);//倒计时总秒数量
    function timer(intDiff,gid){
      var aa=window.setInterval(function(){
        var day=0,
                hour=0,
                minute=0,
                second=0;//时间默认值
        if(intDiff > 0){
          day = Math.floor(intDiff / (60 * 60 * 24));
          hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
          minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
          second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
        }
        if (minute <= 9) minute = '0' + minute;
        if (second <= 9) second = '0' + second;
        $('#day_show').html(day+"天");
        $('#hour_show').html('<s id="h"></s>'+hour+'时');
        $('#minute_show').html('<s></s>'+minute+'分');
        $('#second_show').html('<s></s>'+second+'秒');
        intDiff--;
        if(intDiff < 0){
          aa=window.clearInterval(aa);
          $("#zutuan").find("div").hide();
          //alert(gid);
          var str='<div class="time-item" style="text-align: center"> ' +
                  '<span>打卡进行中</span> </div>';
          $("#time").html(str);
          $("#zutuan").html(strc);
        }
      }, 1000);

    }
    $(function(){
      timer(intDiff,gid);

    });

  </script>


  <style>
  select {
    appearance:none;
    -moz-appearance:none;
    -webkit-appearance:none;
    padding-right: 14px;
  }


  /*清除ie的默认选择框样式清除，隐藏下拉箭头*/
  select::-ms-expand { display: none; }
</style>
  <div class="Fighting"> 
    <img src="../addons/dashen_zaoqizhuanqian/images/todaywartitle.png">    
    <div class="Des"><span class="Success"><em>{php echo $success_total+(int)($this->xnumber*$this->xbili/10)}</em>成功</span><span class="Fail"><em>{php echo $fail_total+(int)($this->xnumber*(10-$this->xbili)/10)}</em>失败</span></div>
  </div>
  <div class="TodayStarLsit">
    <ul>
      <li DataUid="20515">
        <div class="Face"> <img src="{php echo $zqzx['headimgurl']==''?'../addons/dashen_zaoqizhuanqian/images/moren.jpg':$zqzx['headimgurl']}"> </div>
        <div class="Label Label1">早起之星</div>
        <div class="Name">{$zqzx['nickname']}</div>
        <div class="Text">{php echo date('H:i',strtotime($zqzx['daka_datatime']))}打卡</div>
      </li>
      <li DataUid="20321">
        <div class="Face"> <img src="{php echo $sqzx['headimgurl']==''?'../addons/dashen_zaoqizhuanqian/images/moren.jpg':$sqzx['headimgurl']}"></div>
        <div class="Label Label2">手气之星</div>
        <div class="Name">{$sqzx['nickname']}</div>
        <div class="Text">{php echo $sqzx['user_total_money']==''?'0':$sqzx['user_total_money']}元</div>
      </li>
      <li DataUid="19934">
        <div class="Face"> <img src="{php echo $ylzx['headimgurl']==''?'../addons/dashen_zaoqizhuanqian/images/moren.jpg':$ylzx['headimgurl']}"></div>
        <div class="Label Label3">毅力之星</div>
        <div class="Name">{$ylzx['nickname']}</div>
        <div class="Text">连续{php echo $ylzx['user_total_score']==''?'0':$ylzx['user_total_score']}次</div>
      </li>
    </ul>
    <div class="both"></div>
  </div>
  <!-- 广告 -->
  <div class="RanKingTitle"><img src="../addons/dashen_zaoqizhuanqian/images/jb.png"><span>今日排行榜 TOP<em>10</em></span></div>
  <div class="RanKingNav">
    <ul>
      <li id="aaa" class="Hover" DataValue="Luck">手气榜</li>
      <li DataValue="Morning">早起榜</li>
      <li DataValue="Will">毅力榜</li>
    </ul>
    <div class="both"></div>
  </div>
  <div class="RanKingList">
    <ul>
    </ul>
    <div class="both"></div>
  </div>
  <div class="Load"></div>
  <script>

    $(".RanKingNav ul li").click(
            function () {
              $('.RanKingList ul').empty();
              var Value = $(this).attr('DataValue');
              var uniacid="{$_W['uniacid']}";
              $(this).addClass('Hover').siblings().removeClass('Hover');
              $.ajax({
                url: './index.php?i='+uniacid+'&c=entry&do=Jrmx&m=dashen_zaoqizhuanqian&value='+Value,
                type: 'post',
                beforeSend:function(XMLHttpRequest){
                  $('.fixed_load').show();
                },
                success:function(Results){
                  console.log(Results);
                  $('.Load').html('');
                  $('.RanKingList ul').html('');
                  $('.fixed_load').hide();
                  var Html = '';
                  var date='';

                  var data = $.parseJSON(Results);
                  $.each(data,function (k,v) {
                    if(v.date != null){
                      date=v.date;
                    }
                    Html += '<li style="position: relative"> <div class="Face"><img src="'+v.headimgurl+'"></div> <span class="Name" style="width: 45%">'+v.nickname+'</span> <span class="Money"><em>'+v.sss+'</em></span> </li>';
                  });
                  $('.RanKingList ul').html(Html);
                },
                error:function(XMLHttpRequest){
                  $('.fixed_load').hide();
                  $.MsgBox.Alert('消息',"请求失败，错误状态为："+XMLHttpRequest.status);
                }
              });
            }
    )
    $($("#aaa").trigger("click"));
  </script>
  <!-- 广告 -->
  {if $other['pic']!=''}
  <div class="Ad">
    <a href="{$other['ad_url']}" class="AppLink"><img src="{$other['pic']}"></a>
  </div>
  {/if}
  <div class="both"></div>
 {if $blist !=null}
  {template buttom}
  {/if}
  <!-- 打卡失败 -->
  <div class="FixedMask FixedFail">
    <table cellpadding="0" cellspacing="0">
      <tr>
        <td>
          <div class="FixedMaskContent">
            <div class="Title">很遗憾，你来晚了</div>
            <div class="Time">每日打卡时间{php echo $b.'-'.$d}</div>
            <div class="Des">
                <p>懒虫，你起晚了</p><p>不要放弃再挑战一次！</p>
            </div>
            <div class="FailBtn">不甘心 我要早起</div>
          </div>
          <div class="CloseBtn"></div>
        </td>
      </tr>
    </table>
  </div>
  
  <!-- 打卡成功 -->
  <div class="FixedMask FixedSuccess">
    <table cellpadding="0" cellspacing="0">
      <tr>
        <td>
          <div class="FixedMaskContent">
            <div class="Title">恭喜你，打卡成功！</div>
            <div class="Time">每日打卡时间{php echo $b.'-'.$d}</div>
            <div class="Des">
              <p>今日可瓜分奖励池奖金</p><p>{$d}点打卡结束后，可在<em>我的战绩页</em>查看瓜分金额</p>
            </div>
            <div class="CloseBtn"></div>
          </div>
        </td>
      </tr>
    </table>
  </div>

  <!-- 签到时间提醒 -->
  <div class="FixedClockTimeErr"><div class="FixedClockTimeMain">打卡时间：明日 {php echo $b.'-'.$d}</div></div>
  <!-- 定位 -->
  <div id="FgetLocation" Lat='' Lng='' Address=''></div>

  <script>
    $(document).on('click',".CountDownTime",function(){//打卡
	  var uniacid  = <?php echo $uniacid?>;
      $.ajax({
        url: './index.php?i='+uniacid+'&c=entry&do=Sign&m=dashen_zaoqizhuanqian',//发送请求的地址
        type: 'get',
        dataType:'json',
        contentType: "application/x-www-form-urlencoded; charset=utf-8", 
        beforeSend:function(XMLHttpRequest){
        $('.fixed_load').show();
        },
        success:function(Data){
          $('.fixed_load').hide();
          if(Data.State == 200){//打卡成功
          $('.fixed_box').show();
          $('.FixedSuccess').show().removeClass('a-bounceoutT').addClass('a-bounceinT');
          }else if(Data.State == 201){//时间未到
          $('.FixedClockTimeErr').fadeIn(1000,function(){
          $(this).delay(1000).fadeOut(1000);
          });
          }else if(Data.State == 202){//时间已过
          $('.fixed_box').show();
          $('.FixedFail').show().removeClass('a-bounceoutT').addClass('a-bounceinT');
          }else{
          $.MsgBox.Alert('消息',Data.Msg);
          }
          },
          error:function(XMLHttpRequest){
          $('.fixed_load').hide();
          $.MsgBox.Alert('消息',"请求失败，错误状态为："+XMLHttpRequest.status);
          }
        });
      });
      //关闭成功弹窗
      $('.FixedMask .CloseBtn').on('click',function(e){
      var FixedMask = $(this).parents('.FixedMask');
      var FixedMaskClass = FixedMask.attr('class');
      FixedMask.removeClass('a-bounceinT').addClass('a-bounceoutT').delay(500).fadeOut('slow',function(){
      $('.fixed_box').hide();
      window.location.reload(true);
      });
    });
  </script>
  <script>
      var uniacid  = <?php echo $uniacid?>;
      var uid  = <?php echo $uid?>;
      var balance="{$user[money]}"
      var tzstate="{php echo $this->tzstate}"
      function change(zstate) {
         if(zstate==1){
           var money=$("#zhuijia").find("option:selected").val();
         }else{
            var money=$("#xuanze").find("option:selected").val();
          }
          if(tzstate==1){
            if(Number(balance)>=Number(money)){
              var a=confirm('是否使用余额支付'+money+'元');
              if(a){
                window.location.href="./index.php?i="+uniacid+"&money="+money+"&zstate="+zstate+"&c=entry&do=yPay&m=dashen_zaoqizhuanqian";
                return false;
              }

            }
          }

          window.location.href="./index.php?i="+uniacid+"&money="+money+"&zstate="+zstate+"&c=entry&do=Pay&m=dashen_zaoqizhuanqian";
      }
      function tiaozhan(money) {
          if(money<=''){
              alert('金额不能小于0');return false;
          }
        if(money==''){
          alert('请选择金额');return false;
        }
        if(tzstate==1){
          if(Number(balance)>=Number(money)){
            var a=confirm('是否使用余额支付'+money+'元');
            if(a){
              window.location.href="./index.php?i="+uniacid+"&money="+money+"&c=entry&do=yPay&m=dashen_zaoqizhuanqian";
              return false;
            }

          }
        }



          window.location.href="./index.php?i="+uniacid+"&money="+money+"&c=entry&do=Pay&m=dashen_zaoqizhuanqian";
      }
  </script>
 {php echo register_jssdk(false);}
  <script>
      wx.ready(function () {
          sharedata = {
              title: "{$share['share_title']}",
              desc: "{$share['share_desc']}",
              link: "{php echo $_W['siteroot'].str_replace('./','app/',$this->createmobileurl('index')).'&fid='.$uid;}",
              imgUrl: "{php echo tomedia($share['share_pic'])}"
          };
          wx.onMenuShareAppMessage(sharedata);
          wx.onMenuShareTimeline(sharedata);
          wx.onMenuShareQQ(sharedata);
          wx.onMenuShareQZone(sharedata);
          wx.onMenuShareWeibo(sharedata);
      });
  </script>

</body>
</html>
